package com.harisucici.websocketlib.utils;


import com.google.gson.reflect.TypeToken;
import com.harisucici.websocketlib.entities.receive.CurrentSessionReceive;
import com.harisucici.websocketlib.entities.receive.SessionListReceive;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class EntityFactory {

    static Type typeSessionList = new TypeToken<List<SessionListReceive>>() {
    }.getType();

    static Type typeCurrentSession = new TypeToken<List<CurrentSessionReceive>>() {
    }.getType();

    static Type typeP2P = new TypeToken<CurrentSessionReceive>() {
    }.getType();

    static Type typeGroup = new TypeToken<CurrentSessionReceive>() {
    }.getType();

    public static final Map<String, Type> ENTITIES_RECEIVE = new HashMap<String, Type>() {
        {
            put(Constants.SESSION_LIST, typeSessionList);
            put(Constants.CURRENT_SESSION, typeCurrentSession);
            put(Constants.P2P, typeP2P);
            put(Constants.GROUP, typeGroup);
        }
    };


}
